# 声明随机
import random

# 1 猜数字小游戏
# num = random.randint(1,100)
# guess = 10
# for i in range(guess):
#     # 在猜测的范围循环
#    times = int(input('请输入你要猜测的数字1-100（共十次哈）'))
#    if  num == times :
#        print('烙铁，你猜对了 u r good !')
#        break
#    elif num > times :
#        print('老铁,猜小了,nonono')
#    else:
#        print('达咩！猜大了！')
# else:
#     print('你没机会啦！！')


#  2 剪刀石头布
# computers = 100
# players = 100
# import random

# while 0 < player < 200:
#     computer = random.randint(1, 3)
#     player = int(input("请输入：剪刀 = 1;石头 = 2;布 = 3"))
#     if player == computer:
#         print("平局了")
#         print(f"电脑分数：{computers},玩家分数：{players}")
#     elif (
#         (player == 1 and computer == 3)
#         or (player == 2 and computer == 1)
#         or (player == 3 and computer == 2)
# ):
#         print("恭喜此回合你赢了")
#         players += 10
#         computers -= 10
#         print(f"电脑分数：{computers},玩家分数：{players}")
#     else:
#         print("不好意思，此回合你输了")
#     players -= 10
#     computers += 10
#     print(f"电脑分数：{computers},玩家分数：{players}")
#     # break
#     while players == 0:
#         print("游戏结束，你输了") 
#         break
#     while players == 200:
#         print("你胜出了")
#         break

# 3 封装函数: 判断一个数组是对称数组?(函数说明文档也要写)
# def symmetry(arr) :
#      """ 对称函数 """
#     # 封装对称函数，使用的是切片方式  单词是有道翻译，对称的意思
#     # name = "abcdefg"
#     # print(name[::-1]) # gfedcba
#      return arr == arr[::-1]

# arr1 = [1,2,0,2,1]
# arr2 =[1,2,3,3,2,1]
# print(symmetry(arr1))
# print(symmetry(arr2))


# 4 找出列表a=[“hello”，“world”，“yoyo”,“congratulations”]中单词最长的一个
arr = ["hello", "world", "y", "congratulations"]
print(min(arr))
print(max(arr))
